Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reg_preimage columns in KeccakStark #1279

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

LindaGuiga
Copy link
Contributor

@LindaGuiga LindaGuiga commented Oct 6, 2023

This PR removes the 50 reg_preimage columns in KeccakStark, at the cost of:

  • introducing 1 timestamp column (to check the link between inputs and outputs by validating the timestamp against KeccakSpongeStark),
  • separating the inputs from the outputs in Keccak's CTLs (so one extra CTL with one looked Keccak table and one looking KeccakSponge table).

@LindaGuiga
Copy link
Contributor Author

@npwardberkeley If you have some time, would you mind taking a look at this and letting me know what you think?

@npwardberkeley npwardberkeley self-requested a review October 6, 2023 18:34
@@ -53,7 +63,7 @@ impl<F: RichField + Extendable<D>, const D: usize> KeccakStark<F, D> {
/// in our lookup arguments, as those are computed after transposing to column-wise form.
fn generate_trace_rows(
&self,
inputs: Vec<[u64; NUM_INPUTS]>,
inputs: Vec<([u64; NUM_INPUTS], usize)>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename to inputs_and_timestamps?

Column::single(reg_step(NUM_ROUNDS - 1))
}

pub fn ctl_filter_input<F: Field>() -> Column<F> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: for consistency, I think it should be inputs and outputs, and inputs should come first

Copy link
Contributor

@npwardberkeley npwardberkeley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few very minor comments

@LindaGuiga LindaGuiga merged commit e58d779 into 0xPolygonZero:main Oct 6, 2023
2 checks passed
@Nashtare Nashtare deleted the remove-keccak-cols branch October 7, 2023 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants